GH-49155: [C++][IPC] Allow disabling extension type deserialization#49157
Closed
AliRana30 wants to merge 14 commits intoapache:mainfrom
Closed
GH-49155: [C++][IPC] Allow disabling extension type deserialization#49157AliRana30 wants to merge 14 commits intoapache:mainfrom
AliRana30 wants to merge 14 commits intoapache:mainfrom
Conversation
…imit and style guide
The TEST(TestSparseCSFIndex, EqualsMismatchedDimensions) test created SparseCSFIndex objects with empty tensors (nullptr buffers, 0-length shape), causing segfaults during validation on ASAN/UBSAN and 'front() called on empty vector' errors on MSVC. The typed test TestEqualityMismatchedDimensions already properly validates the fix with valid CSF index structures.
Keep only essential size checks. Maintainers requested reverting formatting changes to reduce diff noise and improve readability.
The axis_order().size() check was unnecessary because vector equality operator already compares sizes. Keeping only the essential checks for indices() and indptr() that prevent segfault from out-of-bounds access.
Co-authored-by: Rok Mihevc <rok@mihevc.org>
Co-authored-by: Rok Mihevc <rok@mihevc.org>
GitHub's 'Commit suggestion' feature added rok's implementation but didn't remove the old code, causing duplicate definition error. Removed old implementation to keep only the cleaner C++20 ranges version.
Co-authored-by: Rok Mihevc <rok@mihevc.org>
…tion Add extension_types_blocked option to IpcReadOptions to allow users to disable extension type deserialization for security/robustness. When enabled, extension types are returned as their storage types instead of calling custom deserialization code.
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Rationale for This Change
Applications consuming IPC data from untrusted sources may want to avoid executing potentially buggy third-party extension type deserialization code. Currently, there is no mechanism to disable extension type deserialization when reading IPC files or streams. This creates a security and robustness concern for applications that prefer to work with storage types instead of risking crashes or undefined behavior from custom deserialization implementations in third-party extension types.
What Changes Are Included in This PR?
This change adds a new boolean field
extension_types_blockedto theIpcReadOptionsstruct. When set totrue, extension types encountered during IPC deserialization are returned as their underlying storage types instead of calling customExtensionType::Deserialize()methods.Are These Changes Tested?
Yes. The implementation is backward compatible by design—the default value of
extension_types_blockedisfalse, which preserves all existing behavior.All current tests continue to pass without modification.Are There Any User-Facing Changes?
Yes. A new option is available in the
IpcReadOptionsAPI: